package riceSystem.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import riceSystem.dao.DaoTemplateInterface;
import riceSystem.entity.Information;
import riceSystem.exception.RunException;
import riceSystem.service.ServiceTemplateInterface;
@Component("informationService")
public class InfomationServiceImpl implements ServiceTemplateInterface<Information> {
	
	private DaoTemplateInterface<Information> informationDao;
	
	public DaoTemplateInterface<Information> getInformationDao() {
		return informationDao;
	}
	@Resource(name="informationDao")
	public void setInformationDao(DaoTemplateInterface<Information> informationDao) {
		this.informationDao = informationDao;
	}

	public void add(Information t) throws RunException {
		informationDao.save(t);
	}

	public void removeById(long id) throws RunException {
		informationDao.deleteById(id);
	}

	public void remove(Information t) throws RunException {
		informationDao.delete(t);
	}

	public long update(Information t) throws RunException {
		return informationDao.update(t);
	}

	public Information getById(long id) throws RunException {
		return informationDao.loadById(id);
	}

	public List<Information> getAll() throws RunException {
		return informationDao.loadAll();
	}
}
